﻿
#include "senserclient.h"
#include <QDebug>

SenserClient::SenserClient()
{

}

SenserClient::~SenserClient()
{

}

//#pragma region 全局接口

void SenserClient::OnConnect(const::Ice::Current& current)
{
    qDebug()<< __FUNCTION__;
//    auto items = m_context->watchers();
//    for (const auto& it : items)
//    {
//        it->onServerConnectComplate();
//    }
}

void SenserClient::OnTaskIdChanged(int wb_id, long long task_id, const::Ice::Current& current)
{
    qDebug()<< __FUNCTION__;
//    m_context->onTaskIdChanged(wb_id, task_id);
}

void SenserClient::OnSystemWorkModes(desig::slice_api::SystemWorkModeArray mode_list, const::Ice::Current& current)
{
    qDebug()<< __FUNCTION__;
//    std::vector<working::SystemWorkMode> mode_items;
//    for (size_t i = 0; i < mode_list.size(); i++)
//    {
//        mode_items.push_back(static_cast<working::SystemWorkMode>(mode_list.at(i)));
//    }
//    m_context->iceSettingServer()->setSystemModeInfo(mode_items);
}

void SenserClient::OnControlModeChanged(desig::slice_api::ControlMode mode, const ::Ice::Current& current)
{
    qDebug()<< __FUNCTION__;
//    working::StateInfo dst_value;
//    dst_value.key = "ControlModel";
//    dst_value.value = mode == desig::slice_api::ControlMode::kLocal ? "本控" : "远控";
//    m_context->iceStateServer()->ReportState(dst_value);
}

void SenserClient::OnDetectLibrariesInfos(desig::slice_api::DetectAlgLibraryInfoArray libraries, const::Ice::Current& current)
{

}

void SenserClient::OnRecogLibrariesInfos(desig::slice_api::RecogAlgLibraryInfoArray libraries, const::Ice::Current& current)
{
//    std::vector<desig::working::AlgLibaray> lib_items;
//    IceConvert::Convert(libraries, lib_items);
//    m_context->iceAlgLibarayServer()->setIdenAlgLibarays(lib_items);
}

void SenserClient::OnDemodLibrariesInfos(desig::slice_api::DemodAlgLibraryInfoArray libraries, const::Ice::Current& current)
{
//    std::vector<desig::working::AlgLibaray> lib_items;
//    IceConvert::Convert(libraries, lib_items);
//    m_context->iceAlgLibarayServer()->setDemodAlgLibarays(lib_items);
}

void SenserClient::OnMessage(desig::slice_api::MessageInfoArray msg_list, const ::Ice::Current& current)
{
//    for (size_t i = 0; i < msg_list.size(); i++)
//    {
//        desig::working::MessageInfo info;
//        IceConvert::Convert(msg_list[i], info);
//        m_context->messageServer()->sendMessage(info);
//    }
}

void SenserClient::OnStates(::std::string key, ::std::string value, const ::Ice::Current& current)
{
//    working::StateInfo dst_value;
//    dst_value.key = key;
//    dst_value.value = value;
//    m_context->iceStateServer()->ReportState(dst_value);
}

void SenserClient::OnUpdateSettingInfos(desig::slice_api::SettingInfoArray SettingInfos, const ::Ice::Current& current)
{
//    std::vector<working::SettingItem> SettingItems;
//    IceConvert::Convert(SettingInfos, SettingItems);
//    m_context->iceSettingServer()->onUpdateSetting(SettingItems);
}

void SenserClient::OnComponentInfo(desig::slice_api::ComponentInfoArray infos, const ::Ice::Current& current)
{
//    std::vector<working::PluginInfo> plugin_items;
//    for (size_t i = 0; i < infos.size(); i++)
//    {
//        working::PluginInfo item;
//        item.id = infos[i].guid;
//        item.name = infos[i].name;
//        item.title = infos[i].title;
//        item.introduction = infos[i].introduction;
//        item.ip = infos[i].network_ip;
//        item.port = infos[i].network_port;
//        item.server_name = infos[i].network_name;
//        item.signal_type_list.assign(infos[i].support_signal_types.begin(), infos[i].support_signal_types.end());
//        plugin_items.push_back(item);
//    }
//    m_context->icePluginServer()->updatePlugins(plugin_items);
}

void SenserClient::OnDeleteListGroupInfo(desig::slice_api::ListType type, desig::slice_api::StringArray ids, const ::Ice::Current& current)
{
//    working::SignalListType _type = (working::SignalListType)((int)type);
//    for (size_t i = 0; i < ids.size(); i++)
//    {
//        m_context->iceSignalListServer()->onRemoveSignalList(ids.at(i), _type);
//    }
}

void SenserClient::OnCreateListGroupInfo(desig::slice_api::ListType type, desig::slice_api::ListGroupInfoArray groups, const ::Ice::Current& current)
{
//    working::SignalListType list_type = (working::SignalListType)((int)type);
//    std::vector<working::SignalList> dst_value;
//    IceConvert::Convert(groups, dst_value);
//    for (size_t i = 0; i < dst_value.size(); i++)
//    {
//        dst_value[i].list_type = list_type;
//    }
//    m_context->iceSignalListServer()->onAddSignalList(dst_value, list_type);
}

void SenserClient::OnUpdateListGroupInfo(desig::slice_api::ListType type, desig::slice_api::ListGroupInfoArray groups, const ::Ice::Current& current)
{
//    std::vector<working::SignalList> dst_value;
//    IceConvert::Convert(groups, dst_value);
//    working::SignalListType list_type = (working::SignalListType)((int)type);
//    for (size_t i = 0; i < dst_value.size(); i++)
//    {
//        dst_value[i].list_type = list_type;
//    }
//    m_context->iceSignalListServer()->onUpdateSignalList(dst_value, list_type);
}

void SenserClient::OnDeleteListSignalInfo(desig::slice_api::ListType type, desig::slice_api::ListGroupArray groups, const ::Ice::Current& current)
{
//    std::vector<working::SignalList> dst_value;
//    IceConvert::Convert(groups, dst_value);
//    working::SignalListType list_type = (working::SignalListType)((int)type);
//    for (size_t i = 0; i < dst_value.size(); i++)
//    {
//        m_context->iceSignalListServer()->onRemoveSignalListItem(dst_value[i].list, dst_value[i].id, list_type);
//    }
}

void SenserClient::OnCreateListSignalInfo(desig::slice_api::ListType type, desig::slice_api::ListGroupArray groups, const ::Ice::Current& current)
{
//    std::vector<working::SignalList> dst_value;
//    IceConvert::Convert(groups, dst_value);
//    for (auto& item : dst_value)
//    {
//        for (auto& it : item.list)
//        {
//            Waveform waveform;
//            m_context->iceWaveformServer()->getWaveform(it.waveform_id, waveform);
//            it.signal_type = waveform.name;
//        }
//    }
//    working::SignalListType list_type = (working::SignalListType)((int)type);
//    for (size_t i = 0; i < dst_value.size(); i++)
//    {
//        m_context->iceSignalListServer()->onAddSignalListItem(dst_value[i].list, dst_value[i].id, list_type);
//    }
}

void SenserClient::OnUpdateListSignalInfo(desig::slice_api::ListType type, desig::slice_api::ListGroupArray groups, const ::Ice::Current& current)
{
//    std::vector<working::SignalList> dst_value;
//    IceConvert::Convert(groups, dst_value);
//    working::SignalListType list_type = (working::SignalListType)((int)type);
//    for (auto& item : dst_value)
//    {
//        for (auto& it : item.list)
//        {
//            Waveform waveform;
//            m_context->iceWaveformServer()->getWaveform(it.waveform_id, waveform);
//            it.signal_type = waveform.name;
//        }
//    }
//    for (size_t i = 0; i < dst_value.size(); i++)
//    {
//        m_context->iceSignalListServer()->onUpdateSignalListItem(dst_value[i].list, dst_value[i].id, list_type);
//    }
}

void SenserClient::OnCreatedWaveforms(desig::slice_api::WaveformInfoArray waveforms, const ::Ice::Current& current)
{
//    std::vector<working::Waveform> dst_value;
//    IceConvert::Convert(waveforms, dst_value);

//    m_context->iceSignalListServer()->onAddWaveform(dst_value);
//    m_context->iceWaveformServer()->onAddWaveform(dst_value);
}

void SenserClient::OnUpdatedWaveforms(desig::slice_api::WaveformInfoArray waveforms, const ::Ice::Current& current)
{
//    std::vector<working::Waveform> dst_value;
//    IceConvert::Convert(waveforms, dst_value);
//    m_context->iceSignalListServer()->onUpdateWaveform(dst_value);
//    m_context->iceWaveformServer()->onUpdateWaveform(dst_value);
}

void SenserClient::OnDeletedWaveforms(desig::slice_api::StringArray waveformIds, const ::Ice::Current& current)
{
//    m_context->iceSignalListServer()->onRemoveWaveform(waveformIds);
//    m_context->iceWaveformServer()->onRemoveWaveform(waveformIds);
}

//#pragma endregion

//#pragma region 设备模块接口

void SenserClient::OnDeviceInfos(desig::slice_api::DeviceInfoArray list, const Ice::Current& current)
{
//    std::vector<desig::working::DeviceInfo>device_list;
//    for (size_t i = 0; i < list.size(); i++)
//    {
//        desig::working::DeviceInfo info;
//        info.serial = list[i].serial;
//        info.type = list[i].type;
//        info.introduction = list[i].introduction;
//        info.versions.assign(list[i].versions.begin(), list[i].versions.end());
//        info.builtin_device = list[i].builtin_device;
//        device_list.push_back(info);
//    }
//    m_context->iceDeviceServer()->onSerachDeviceList(device_list);
}

void SenserClient::OnSelectDevice(desig::slice_api::DeviceInfo info, const Ice::Current& current)
{
//    desig::working::DeviceInfo device_info;
//    device_info.serial = info.serial;
//    device_info.type = info.type;
//    device_info.versions.assign(info.versions.begin(), info.versions.end());
//    device_info.builtin_device = info.builtin_device;
//    m_context->iceDeviceServer()->onConnectDevice(device_info);
}

void SenserClient::OnDeviceSettingsChanged(desig::slice_api::DeviceSettings setting, const Ice::Current& current)
{
//    working::DeviceProfile profile;
//    IceConvert::Convert(setting, profile);
//    m_context->iceDeviceServer()->onDevicePorfile(profile);
//    m_context->onInit();
}

void SenserClient::OnDeviceNarrowbandSettingsChanged(desig::slice_api::DeviceNarrowbandSettings setting, const::Ice::Current& current)
{
//    working::NBChProfile profile;
//    IceConvert::Convert(setting, profile);
//    m_context->iceDeviceServer()->onDeviceNarrowbandSettingsChanged(profile);
//    m_context->iceHighSpeedDemodServer()->onDeviceNarrowbandSettingsChanged(profile);
}

void SenserClient::OnFPGALoadStart(std::string guid, const Ice::Current& current)
{
//    m_context->iceDeviceServer()->onLoadFpgaStared(guid);
}

void SenserClient::OnFPGALoadProgress(int progress, const Ice::Current& current)
{
//    m_context->iceDeviceServer()->onLoadFpgaProgress(progress);
}

void SenserClient::OnFPGALoadComplete(std::string guid, bool success, const Ice::Current& current)
{
//    m_context->iceDeviceServer()->onLoadFpgaEnd(guid,success);
}

void SenserClient::OnDeviceRunningStatus(bool status, const Ice::Current& current)
{
//    m_context->iceDeviceServer()->onDeviceRunStateChanged(status);
}

void SenserClient::OnDeviceConnectStatus(bool status, const Ice::Current& current)
{
//    m_context->iceDeviceServer()->onDeviceConnectStateChanged(status);
}

void SenserClient::OnFrequnecyConverterChanged(int wb_id, desig::slice_api::FreqConverterInfo converter, const Ice::Current& current)
{
//    working::FreqConverterInfo info;
//    info.enable = converter.enable;
//    info.rx_freq = converter.rx_freq;
//    info.tx_freq = converter.tx_freq;
//    m_context->iceSettingServer()->onFrequnecyConverterChanged(wb_id, info);
}

void SenserClient::OnSatelliteInfoChanged(int wb_id, desig::slice_api::SatelliteInfo info, const Ice::Current& current)
{
//    working::SatelliteInfo sat_info;
//    sat_info.id = info.id;
//    sat_info.name = info.name;
//    sat_info.jh = info.polarization;
//    sat_info.freq_band = info.freq_range;
//    m_context->iceSettingServer()->onSatelliteInfoChanged(wb_id, sat_info);
}

void SenserClient::OnInvertSpectrumChanged(int wb_id, bool invert_spectrum, const Ice::Current& current)
{
//    m_context->iceSettingServer()->onInvertSpectrumChanged(wb_id, invert_spectrum);
}

void SenserClient::OnRadioInputChannelChanged(int channel, const Ice::Current& current)
{
    //m_context->iceDeviceServer()->onRFInputChannelChanged(0, channel);
}

void SenserClient::OnDeviceChannelEnablementStatus(int wb_id, bool status, const::Ice::Current& current)
{
//    m_context->iceDeviceServer()->onChannelEnableChanged(wb_id, status);
}

void SenserClient::OnDeviceWorkModeChanged(int wb_id, desig::slice_api::DeviceWorkMode mode, const Ice::Current& current)
{
//    m_context->iceDeviceServer()->onWorkModeChanged(wb_id, (working::DeviceWorkMode)mode);
}

void SenserClient::OnDeviceParamsChanged(int wb_id, desig::slice_api::FrequnecyInfo info, const Ice::Current& current)
{
//    working::DeviceFreqParams params;
//    params.begin_freq = info.begin_frequnecy;
//    params.end_freq = info.end_frequnecy;
//    params.step_bandwidth = info.step_bandwidth;
//    params.step_duration = info.step_residence_time;
//    m_context->iceDeviceServer()->onWorkParamChanged(wb_id, params);
}

void SenserClient::OnLevelChanged(int wb_id, float level, const Ice::Current& current)
{
//    m_context->iceDeviceServer()->onRFLevelChanged(wb_id, level);
}

void SenserClient::OnGainChanged(int wb_id, desig::slice_api::GainControlType type, desig::slice_api::GainMode mode, float gain, const Ice::Current& current)
{
//    m_context->iceDeviceServer()->onGainValueChanged(wb_id, (working::DeviceGainMode)mode, gain);
}

void SenserClient::OnTransmissionGainChanged(int wb_id, float gain, const::Ice::Current& current)
{
//    m_context->iceDeviceServer()->onTransmissionGainChanged(wb_id, gain);
}

void SenserClient::OnDigitalGainChanged(int wb_id, float gain, const Ice::Current& current)
{
//    m_context->iceDeviceServer()->onDigitalGainValueChanged(wb_id, gain);
}

void SenserClient::OnDevicePlaybackStateChanged(int wb_id, desig::slice_api::PlaybackStatus status, const Ice::Current& current)
{
//    m_context->iceDeviceServer()->onPlayBackRunStateChanged(wb_id, status == desig::slice_api::PlaybackStatus::kPlay);
}

void SenserClient::OnDevicePlaybackLoopStateChanged(int wb_id, bool loop, const Ice::Current& current)
{
//    m_context->iceDeviceServer()->onPlayBackLoopStateChanged(wb_id, loop);
}

void SenserClient::OnDevicePlaybackParamsChanged(int wb_id, desig::slice_api::PlaybackInfo info, const Ice::Current& current)
{
//    working::DevicePlaybackParams params;
//    params.data_type = (working::DeviceWBDataType)info.format;
//    params.files.assign(info.files.begin(), info.files.end());
//    params.sample_rata = info.sample_rate;
//    params.transmission = info.transmission;
//    m_context->iceDeviceServer()->onPlayBackParamChanged(wb_id, params);
}

void SenserClient::OnDevicePlaybackProgress(int wb_id, desig::slice_api::PlaybackProgress progress, const Ice::Current& current)
{
//    working::DevicePlayBackProgress paly_progress;
//    paly_progress.current_file = progress.file;
//    paly_progress.progress = progress.sample_index * 100.0 / progress.sample_count;
//    m_context->iceDeviceServer()->onPlayBackProgress(wb_id, paly_progress);
}

void SenserClient::OnStartDeviceBroadbandStorage(int wb_id, desig::slice_api::DataFormat format, desig::slice_api::DataStorageInfo info, const Ice::Current& current)
{
//    desig::working::DeviceStoreParams  params;
//    params.store_type = format == desig::slice_api::DataFormat::kAD ? desig::working::DeviceWBDataType::kWB_DATA_ADC : desig::working::DeviceWBDataType::kWB_DATA_DDC;
//    params.store_mode = (desig::working::CustomStoreMode)info.mode;
//    params.store_param = info.size;
//    m_context->iceDeviceServer()->onWBStoreStateChanged(wb_id, true, params);
}

void SenserClient::OnStopDeviceBroadbandStorage(int wb_id, const Ice::Current& current)
{
//    m_context->iceDeviceServer()->onWBStoreStateChanged(wb_id, false, desig::working::DeviceStoreParams());
}

void SenserClient::OnDeviceBroadbandStorageProgress(int wb_id, desig::slice_api::DataStoreProgress progress, const Ice::Current& current)
{
//    m_context->iceDeviceServer()->onWBStoreProgressChanged(wb_id, progress.total_bytes, progress.duration);
}

void SenserClient::OnDeviceBroadbandStorageFile(int wb_id, std::string file_name, const Ice::Current& current)
{
//    m_context->iceDeviceServer()->onWBStoreFileReport(wb_id, file_name);
}

void SenserClient::OnDeviceSpectrumOutputChanged(int wb_id, bool enabled, const Ice::Current& current)
{
//    m_context->iceDeviceServer()->onSpectrumOutputChannelChanged(wb_id, enabled);
}

void SenserClient::OnDeviceSpectrumParamsChanged(int wb_id, desig::slice_api::SpectrumInfo params, const Ice::Current& current)
{
//    m_context->iceDeviceServer()->onSpectrumParamChanged(wb_id, params.fft_order, params.smooth_times);
}

void SenserClient::OnStartDeviceSpectrumStorage(int wb_id, desig::slice_api::SpectrumStorageInfo info, const Ice::Current& current)
{
//    m_context->iceDeviceServer()->onSpectrumStoreChanged(wb_id, true);
}

void SenserClient::OnStopDeviceSpectrumStorage(int wb_id, const Ice::Current& current)
{
//    m_context->iceDeviceServer()->onSpectrumStoreChanged(wb_id, false);
}

void SenserClient::OnDeviceSpectrumStorageProgress(int wb_id, desig::slice_api::DataStoreProgress progress, const Ice::Current& current)
{
//    m_context->iceDeviceServer()->onSpectrumStoreProgress(wb_id, progress.total_bytes, progress.duration);
}

void SenserClient::OnDeviceSpectrumStorageFile(int wb_id, std::string fileName, const Ice::Current& current)
{
//    m_context->iceDeviceServer()->onSpectrumStoreFile(wb_id, fileName);
}

void SenserClient::OnDeviceSpectrumOutput(int wb_id, desig::slice_api::SpectrumPacket packet, const Ice::Current& current)
{
    qDebug() << packet.frame_size << packet.frame_count;
//    working::DeviceSpectrumPacket device_spec_packet;
//    IceConvert::Convert(packet, device_spec_packet);
//    m_context->iceDeviceServer()->onSpectrumPacket(wb_id, device_spec_packet.mode, device_spec_packet);
}

void SenserClient::OnSpectrumDetectorSignal(int channelId, desig::slice_api::SpectrumSignalInfoArray infos, const::Ice::Current& current)
{
//    std::vector<CarrierChannel> carriers;
//    for (size_t i = 0; i < infos.size(); i++)
//    {
//        CarrierChannel item;
//        item.frequency = infos[i].frequnecy;
//        item.bandwidth = infos[i].bandwidth;
//        carriers.push_back(item);
//    }
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(channelId, work_mode);
//    m_context->iceDeviceServer()->onSpectrumCarrierOutput(channelId, work_mode, carriers);
}

void SenserClient::OnStartDeviceSpectrumAnalyzer(int wb_id, const::Ice::Current& current)
{
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(wb_id, work_mode);
//    m_context->iceDeviceServer()->onStartAnalyzer(wb_id, work_mode);
}

void SenserClient::OnStopDeviceSpectrumAnalyzer(int wb_id, bool storage_data, const::Ice::Current& current)
{
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(wb_id, work_mode);
//    m_context->iceDeviceServer()->onStopAnalyzer(wb_id, work_mode);
}

void SenserClient::OnDeviceSpectrumAnalyzerCacheDuration(int wb_id, int duration, const::Ice::Current& current)
{
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(wb_id, work_mode);
//    m_context->iceDeviceServer()->onAnalyzerCacheDuration(wb_id, work_mode, duration);
}

void SenserClient::OnDeviceSpectrumAnalyzeStoreFiles(int wb_id, desig::slice_api::BroadbandFileInfoArray files, const::Ice::Current& current)
{
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(wb_id, work_mode);
//    std::vector<desig::working::SpectrumAnalyzerStoreFile> analyzer_files;
//    for (const auto& file : files)
//    {
//        desig::working::SpectrumAnalyzerStoreFile analyzer_file;
//        analyzer_file.frequency = file.frequency;
//        analyzer_file.bandwidth = file.bandwidth;
//        analyzer_file.sample_rate = file.sample_rate;
//        analyzer_file.data_format = (DeviceWBDataType)file.data_format;
//        analyzer_file.file_path = file.path;
//        analyzer_file.s = file.time.second;
//        analyzer_file.ns = file.time.nanosecond;
//        analyzer_files.push_back(analyzer_file);
//    }
//    m_context->iceDeviceServer()->onAnalyzerStoreFiles(wb_id, work_mode, analyzer_files);
}

//#pragma endregion

//#pragma region 检测模块接口

void SenserClient::OnStartDetectRecog(int channelId, desig::slice_api::DetectRecogInfo value, const ::Ice::Current& current)
{
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(channelId, work_mode);
//    working::DetectRecogParams current_params;
//    IceConvert::Convert(value, current_params);
//    m_context->iceDetectServer()->onStarted(channelId, work_mode, current_params);
}

void SenserClient::OnStopDetectRecog(int channelId, const ::Ice::Current& current)
{
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(channelId, work_mode);
//    m_context->iceDetectServer()->onStopped(channelId, work_mode);
}

void SenserClient::OnDetectRecogProgress(int batch, int signalIndex, ::std::string signalGuid, const ::Ice::Current& current)
{

}

void SenserClient::OnDetectRecogSignals(int channelId, desig::slice_api::DetectRecogSignalArray signal_infos, const ::Ice::Current& current)
{
//    std::vector < working::DetectSignalInfo > _signals;
//    IceConvert::Convert(signal_infos, _signals);

//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(channelId, work_mode);
//    m_context->iceDetectServer()->onReceiveSignal(channelId, work_mode, _signals);
}

void SenserClient::OnDetectRecogSignalStates(int channelId, desig::slice_api::DetectRecogSignalStateArray states, const ::Ice::Current& current)
{
//    std::vector <working::DetectSignalIdenResult> _rsults;
//    IceConvert::Convert(states, _rsults);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(channelId, work_mode);
//    m_context->iceDetectServer()->onReceiveSignalIdenResult(channelId, work_mode, _rsults);
}

void SenserClient::OnDetectRecogSignalSampleFile(int wb_id, ::std::string signal_id, ::std::string ddc_file, ::std::string demod_file, ::std::string decode_file, const ::Ice::Current& current)
{
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(wb_id, work_mode);
//    m_context->iceDetectServer()->onReceiveSignalSampleFile(wb_id, work_mode, signal_id, ddc_file, demod_file, decode_file);
}

void SenserClient::OnDetectRecogAutoCollectStatus(int channelId, bool collect_known_signal, bool collect_unknown_signal, const ::Ice::Current& current)
{
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(channelId, work_mode);
//    m_context->iceDetectServer()->onAutoCollectStateChanged(channelId, work_mode, collect_known_signal, collect_unknown_signal);
}

void SenserClient::OnDetectRecogSampleStoreStatus(int channelId, bool enabled, const ::Ice::Current& current)
{
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(channelId, work_mode);
//    m_context->iceDetectServer()->onSampleStoreStateChanged(channelId, work_mode, enabled);
}

void SenserClient::OnCrateDetectRecogSignal(int channelId, desig::slice_api::DetectRecogSignalArray signal_array, const ::Ice::Current& current)
{
//    std::vector <working::DetectSignalInfo> _signals;
//    IceConvert::Convert(signal_array, _signals);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(channelId, work_mode);
//    m_context->iceDetectServer()->onReceiveSignal(channelId, work_mode, _signals);
}

void SenserClient::OnDeleteDetectRecogSignal(int channelId, desig::slice_api::StringArray sigIds, const ::Ice::Current& current)
{

}

//#pragma endregion

//#pragma region 控守模块接口

void SenserClient::OnCreateCollectSignals(int ch, desig::slice_api::CollectSignalArray signal_infos, const ::Ice::Current& current)
{
//    if (signal_infos.size() > 0)
//    {
//        std::vector<desig::working::CollectChannel> collectChannels;
//        IceConvert::Convert(signal_infos, collectChannels);
//        for (size_t i = 0; i < collectChannels.size(); i++)
//        {
//            collectChannels[i].wb_ch_id = ch;
//            collectChannels[i].enable = false;
//            collectChannels[i].store = false;
//        }
//        desig::working::DeviceWorkMode work_mode = (desig::working::DeviceWorkMode)signal_infos.at(0).from_work_mode;
//        m_context->iceCollectServer()->onCreateChannel(ch, work_mode, collectChannels);
//    }
}

void SenserClient::OnDeleteCollectSignals(int ch, desig::slice_api::StringArray signal_infos, const ::Ice::Current& current)
{
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch, work_mode);
//    m_context->iceCollectServer()->onRemoveChannel(ch, work_mode, signal_infos);
}

void SenserClient::OnUpdateCollectSignals(int ch, desig::slice_api::CollectSignalArray signal_infos, const ::Ice::Current& current)
{
//    std::vector<desig::working::CollectChannel> collectChannels;
//    IceConvert::Convert(signal_infos, collectChannels);
//    for (size_t i = 0; i < collectChannels.size(); i++)
//    {
//        collectChannels[i].wb_ch_id = ch;
//    }
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch, work_mode);
//    m_context->iceCollectServer()->onUpdateChannel(ch, work_mode, collectChannels);
}

void SenserClient::OnCollectSignalWorkStatus(int ch, desig::slice_api::StringArray ids, bool status, const ::Ice::Current& current)
{
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch, work_mode);
//    m_context->iceCollectServer()->onChannelEnableChanged(ch, work_mode, ids, status);
}

void SenserClient::OnCollectSignalStoreStatus(int ch, desig::slice_api::StringArray ids, bool status, const ::Ice::Current& current)
{
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch, work_mode);
//    m_context->iceCollectServer()->onChannelStoreChanged(ch, work_mode, ids, status);
}

void SenserClient::OnCollectSignalAnalysisStatus(int ch, desig::slice_api::StringArray ids, bool status, const ::Ice::Current& current)
{
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch, work_mode);
//    m_context->iceCollectServer()->onChannelAnalyzerChanged(ch, work_mode, ids, status);
}

void SenserClient::OnCollectSignalCarrierNoiseRate(int ch, string sigId, float carrier_noise_rate, const::Ice::Current& current)
{
//        desig::working::DeviceWorkMode work_mode;
//        m_context->deviceServer()->getWorkMode(ch, work_mode);
//        m_context->iceCollectServer()->onCarrierNoiseRate(ch, work_mode, sigId, carrier_noise_rate);
}

void SenserClient::OnCollectSignalStoreProgress(int ch, ::std::string sigId, desig::slice_api::DataStoreProgress progress, const ::Ice::Current& current)
{
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch, work_mode);
//    m_context->iceCollectServer()->onStoreFileProgress(ch, work_mode, sigId, progress.total_bytes, progress.duration);
}

void SenserClient::OnCollectSignalStoreFile(int ch, ::std::string sigId, ::std::string fileName, const ::Ice::Current& current)
{
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch, work_mode);
//    m_context->iceCollectServer()->onStoreFilePath(ch, work_mode, sigId, fileName);
}

//#pragma endregion

//#pragma region 载波分析模块接口

void SenserClient::OnAnalysisParamsChanged(desig::slice_api::AnalysisInfo carrier, const::Ice::Current& current)
{
//    working::CarrierMeasureChParams params;
//    params.ch_id = carrier.channel_id;
//    params.fc = carrier.frequency;
//    params.bw = carrier.bandwidth;
//    params.fs = carrier.sample_rate;
//    params.data_format = (working::DeviceWBDataType)carrier.data_format;
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(carrier.channel_id, work_mode);
//    m_context->iceMesureServer()->onReportChannelParams(carrier.channel_id, work_mode, params);
}

void SenserClient::OnStartAnalysis(const ::Ice::Current& current)
{
//    int32_t active_ch_id=0;
//    m_context->mesureServer()->getActiveChannelId(active_ch_id);

//    int32_t ch_id = 0;
//    m_context->deviceServer()->getActiveChannelId(ch_id);
//    if (active_ch_id != ch_id)
//    {
//        desig::working::DeviceWorkMode active_ch_work_mode;
//        m_context->deviceServer()->getWorkMode(active_ch_id, active_ch_work_mode);
//        m_context->iceMesureServer()->onStoped(active_ch_id, active_ch_work_mode);
//    }
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch_id, work_mode);
//    m_context->iceMesureServer()->onStared(ch_id, work_mode);


}

void SenserClient::OnStopAnalysis(const ::Ice::Current& current)
{
//    desig::working::DeviceProfile profile;
//    m_context->deviceServer()->getDeviceProfile(profile);
//    for (const auto& channel : profile.wb_channel_list)
//    {
//        int ch_id = channel.id;
//        desig::working::DeviceWorkMode work_mode;
//        m_context->deviceServer()->getWorkMode(ch_id, work_mode);
//        m_context->iceMesureServer()->onStoped(ch_id, work_mode);
//    }
}

void SenserClient::OnAnalysisSpectrumParamsChanged(desig::slice_api::SpectrumInfo value, const ::Ice::Current& current)
{
//    int32_t ch_id = 0;
//    m_context->deviceServer()->getActiveChannelId(ch_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch_id, work_mode);
//    m_context->iceMesureServer()->onMesureSpectrumParamsChanged(ch_id, work_mode, value.fft_order, value.smooth_times);
}

void SenserClient::OnStartAnalysisDataStorage(desig::slice_api::DataStorageInfo info, const::Ice::Current& current)
{
//    int32_t ch_id = 0;
//    m_context->mesureServer()->getActiveChannelId(ch_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch_id, work_mode);

//    m_context->iceMesureServer()->onStoreDdcStateChanged(ch_id, work_mode, true);
}

void SenserClient::OnStopAnalysisDataStorage(const::Ice::Current& current)
{
//    int32_t ch_id = 0;
//    m_context->mesureServer()->getActiveChannelId(ch_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch_id, work_mode);

//    m_context->iceMesureServer()->onStoreDdcStateChanged(ch_id, work_mode, false);
}

void SenserClient::OnAnalysisMeasure(bool state, desig::slice_api::AnalysisMeasureResult packet, const ::Ice::Current& current)
{
//    desig::working::CarrierMesureResult info;
//    info.order = packet.order;
//    info.fc = packet.frequency;
//    info.bw = packet.bandwidth;
//    info.rs = packet.symbol_rate;
//    info.fc_points.assign(packet.frequency_points.begin(), packet.frequency_points.end());
//    info.rs_points.assign(packet.symbol_rate_points.begin(), packet.symbol_rate_points.end());

//    int32_t ch_id = 0;
//    m_context->mesureServer()->getActiveChannelId(ch_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch_id, work_mode);
//    m_context->iceMesureServer()->onReportMesureResult(ch_id, work_mode, state, info);
}

void SenserClient::OnAnalysisRecog(bool state, desig::slice_api::AnalysisRecogResult packet, const ::Ice::Current& current)
{
//    desig::working::CarrierIdenResult info;
//    info.fc = packet.frequency;
//    info.bw = packet.bandwidth;
//    info.rs = packet.symbol_rate;
//    info.mod_type = packet.mod_type;
//    info.mod_index = packet.mod_index;
//    info.conf = packet.conf;

//    int32_t ch_id = 0;
//    m_context->mesureServer()->getActiveChannelId(ch_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch_id, work_mode);
//    m_context->iceMesureServer()->onReportSignalIdenResult(ch_id, work_mode, state, info);
}

void SenserClient::OnAnalysisSpectrumOutput(desig::slice_api::AnalysisSpectrumPackets packet, const ::Ice::Current& current)
{
//    std::vector < desig::working::CarrierSpectrumPacket>packets;
//    int freame_count= packet.size();
//    if (packet[0].order == 1 && packet[0].frame_size > 2048)
//    {
//        freame_count = packet.size() > 1 ? 1 : packet.size();
//    }
//    for (size_t i = 0; i < freame_count; i++)
//    {
//        desig::working::CarrierSpectrumPacket info;
//        info.fc = packet[i].frequnecy;
//        info.bw = packet[i].bandwidth;
//        info.fs = packet[i].sample_rate;
//        info.frame_count = 1;
//        info.frame_len = packet[i].frame_size;
//        info.time_sec = packet[i].time.second;
//        info.time_nsec = packet[i].time.nanosecond;
//        info.points.assign(packet[i].datas.begin(), packet[i].datas.end());
//        packets.push_back(info);
//    }
//    int32_t ch_id = -1;
//    m_context->mesureServer()->getActiveChannelId(ch_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch_id, work_mode);
//    m_context->iceMesureServer()->onReportSpectrumPacket(ch_id, work_mode, packet[0].order, packets);
}

void SenserClient::OnAnalysisDataStorageProgress(desig::slice_api::DataStoreProgress progress, const ::Ice::Current& current)
{
//    int32_t ch_id = -1;
//    m_context->mesureServer()->getActiveChannelId(ch_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch_id, work_mode);
//    m_context->iceMesureServer()->onReportStoreDdcProgress(ch_id, work_mode, progress.total_bytes, progress.duration);
}

void SenserClient::OnAnalysisDataStorageFile(::std::string fileName, const ::Ice::Current& current)
{
//    int32_t ch_id = -1;
//    m_context->mesureServer()->getActiveChannelId(ch_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch_id, work_mode);
//    m_context->iceMesureServer()->onReportStoreDdcFile(ch_id, work_mode, fileName);
}

//#pragma endregion

//#pragma region 解调预览模块接口

void SenserClient::OnStartDemod(desig::slice_api::DemodInfo signal, const ::Ice::Current& current)
{
//    desig::working::DemodChanelParams params;
//    params.ch_id = signal.channel_id;
//    params.fc = signal.frequency;
//    params.bw = signal.bandwidth;
//    params.mod_type = signal.mod_type;
//    params.rs = signal.symbol_rate;
//    params.mod_index = signal.mod_index;
//    params.demod_eq = signal.demod_eq;
//    params.demod_lib = signal.demod_lib;

//    int32_t ch_id = 0;
//    m_context->deviceServer()->getActiveChannelId(ch_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch_id, work_mode);
//    m_context->iceDemodServer()->onChannelParamChanged(params.ch_id, work_mode, params);
//    m_context->iceDemodServer()->onStared(params.ch_id, work_mode);
}

void SenserClient::OnStopDemod(const ::Ice::Current& current)
{
//    int32_t ch_id = 0;
//    m_context->demodServer()->getActiveChannelId(ch_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch_id, work_mode);
//    m_context->iceDemodServer()->onStoped(ch_id, work_mode);
}

void SenserClient::OnDemodAnalogOutput(desig::slice_api::AnalogPacket packet, const ::Ice::Current& current)
{
//    desig::working::DemodVoicePacket info;
//    info.sample_rate = (int64_t)packet.sample_rate;
//    for (size_t i = 0; i < packet.datas.size(); i++)
//    {
//        info.voices_data.push_back(packet.datas[i]);
//    }

//    int32_t ch_id = 0;
//    m_context->demodServer()->getActiveChannelId(ch_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch_id, work_mode);
//    m_context->iceDemodServer()->onReceiveVoicePacket(ch_id, work_mode, info);
}

void SenserClient::OnPhaseInfo(desig::slice_api::PhaseInfo info, const::Ice::Current& current)
{
//    int32_t ch_id = 0;
//    m_context->deviceServer()->getActiveChannelId(ch_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch_id, work_mode);
//    desig::working::PhaseInfo data;
//    desig::IceConvert::Convert(info, data);
//    m_context->iceDemodServer()->onPhaseInfo(ch_id, work_mode, data);
}

void SenserClient::OnSignalQualityInfo(desig::slice_api::SignalQualityInfo info, const::Ice::Current& current)
{
//    int32_t ch_id = 0;
//    m_context->deviceServer()->getActiveChannelId(ch_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch_id, work_mode);
//    desig::working::SignalQualityInfo data;
//    desig::IceConvert::Convert(info, data);
//    m_context->iceDemodServer()->onSignalQualityInfo(ch_id, work_mode, data);
}


void SenserClient::OnDemodConstelOutput(desig::slice_api::ConstelPacket packet, const ::Ice::Current& current)
{
//    desig::working::DemodConstelPacket info;
//    int point_size = packet.datas.size() / 2;
//    if (point_size > 1024)
//    {
//        point_size = 1024;
//    }
//    info.ebno = packet.ebn0;
//    info.errbar = packet.est_ber;
//    info.evm = packet.rms_evm;
//    for (size_t i = 0; i < point_size; i++)
//    {
//        info.x_points.push_back(packet.datas[i * 2] / packet.max_value);
//        info.y_points.push_back(packet.datas[i * 2 + 1] / packet.max_value);
//    }

//    int32_t ch_id = 0;
//    m_context->demodServer()->getActiveChannelId(ch_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch_id, work_mode);
//    m_context->iceDemodServer()->onReceiveConstelPacket(ch_id, work_mode, info);
}

void SenserClient::OnDemodSymbolOutput(desig::slice_api::SymbolPacket packet, const ::Ice::Current& current)
{
//    desig::working::DemodBitPacket info;
//    info.len = packet.datas.size();
//    info.bits = std::shared_ptr<double>(new double[info.len], [=](double* p) {delete[] p; });
//    double * p_data= info.bits.get();
//    for (size_t i = 0; i < info.len; i++)
//    {
//        p_data[i]=packet.datas[i];
//    }
//    int32_t ch_id = 0;
//    m_context->demodServer()->getActiveChannelId(ch_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch_id, work_mode);
//    m_context->iceDemodServer()->onReceiveBitPacket(ch_id, work_mode, info);
}

void SenserClient::OnDemodEyeOutput(desig::slice_api::EyePacket packet, const ::Ice::Current& current)
{
//    desig::working::EyePacket info;
//    info.frame_len = packet.frame_length;
//    info.max_value = packet.max_value;
//    info.min_value = packet.min_value;
//    for (size_t i = 0; i < packet.datas.size(); i++)
//    {
//        info.points.push_back(packet.datas[i]);
//    }
//    int32_t ch_id = 0;
//    m_context->demodServer()->getActiveChannelId(ch_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch_id, work_mode);
//    m_context->iceDemodServer()->onReceiveEyePacket(ch_id, work_mode, info);
}

void SenserClient::OnStartDemodResultStorage(const ::Ice::Current& current)
{
//    int32_t ch_id = -1;
//    m_context->demodServer()->getActiveChannelId(ch_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch_id, work_mode);
//    m_context->iceDemodServer()->onStoreStateChanged(ch_id, work_mode, true);
}

void SenserClient::OnStopDemodResultStorage(const ::Ice::Current& current)
{
//    int32_t ch_id = -1;
//    m_context->demodServer()->getActiveChannelId(ch_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch_id, work_mode);
//    m_context->iceDemodServer()->onStoreStateChanged(ch_id, work_mode, false);
}

void SenserClient::OnDemodResultStorageProgress(desig::slice_api::DataStoreProgress progress, const ::Ice::Current& current)
{
//    int32_t ch_id = -1;
//    m_context->demodServer()->getActiveChannelId(ch_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch_id, work_mode);
//    m_context->iceDemodServer()->onReceiveStoreProcess(ch_id, work_mode, progress.total_bytes, progress.duration);
}

void SenserClient::OnDemodResultStorageFile(::std::string fileName, const ::Ice::Current& current)
{
//    int32_t ch_id = 0;
//    m_context->demodServer()->getActiveChannelId(ch_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(ch_id, work_mode);
//    m_context->iceDemodServer()->onReceiveStoreFile(ch_id, work_mode, fileName);
}


void SenserClient::OnHighSpeedDemodParamsChange(int channel_id, slice_api::HighSpeedDemodInfo info, const Ice::Current &current)
{
//    int32_t wb_id = 0;
//    m_context->demodServer()->getActiveChannelId(wb_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(wb_id, work_mode);
//    desig::working::HighSpeedDemodInfo demod_info{};
//    desig::IceConvert::Convert(info, demod_info);
//    m_context->iceHighSpeedDemodServer()->onHighSpeedDemodParamsChange(wb_id, work_mode, channel_id, demod_info);
}
void SenserClient::OnStartHighSpeedDemod(int channel_id, const Ice::Current &current)
{
//    int32_t wb_id = 0;
//    m_context->demodServer()->getActiveChannelId(wb_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(wb_id, work_mode);
//    m_context->iceHighSpeedDemodServer()->onStartHighSpeedDemod(wb_id, work_mode, channel_id);
}
void SenserClient::OnStopHighSpeedDemod(int channel_id, const Ice::Current &current)
{
//    int32_t wb_id = 0;
//    m_context->demodServer()->getActiveChannelId(wb_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(wb_id, work_mode);
//    m_context->iceHighSpeedDemodServer()->onStopHighSpeedDemod(wb_id, work_mode, channel_id);
}
void SenserClient::OnHighSpeedDemodBitstreamInfo(int channel_id, slice_api::BitstreamInfo info, const Ice::Current &current)
{
//    int32_t wb_id = 0;
//    m_context->demodServer()->getActiveChannelId(wb_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(wb_id, work_mode);
//    working::BitstreamInfo bit_info{};
//    {
//        bit_info.data_len = info.data_len;
//        bit_info.data.swap(info.data);
//    }
//    m_context->iceHighSpeedDemodServer()->onHighSpeedDemodBitstreamInfo(wb_id, work_mode, channel_id, bit_info);
}
void SenserClient::OnHighSpeedDemodConstellationDiagramInfo(int channel_id, slice_api::ConstellationDiagramInfo info,
                                                         const Ice::Current &current)
{
//    int32_t wb_id = 0;
//    m_context->demodServer()->getActiveChannelId(wb_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(wb_id, work_mode);
//    working::ConstellationDiagramInfo constell_info{};
//    {
//        constell_info.data_range.begin = info.data_range.begin;
//        constell_info.data_range.end = info.data_range.end;
//        constell_info.ebn0 = info.ebn0;
//        constell_info.evm = info.evm;
//        constell_info.err_bar = info.err_bar;
//        constell_info.data_len = info.data_len;
//        constell_info.data.swap(info.data);
//    }
//    m_context->iceHighSpeedDemodServer()->onHighSpeedDemodConstellationDiagramInfo(wb_id, work_mode, channel_id,
//                                                                                   constell_info);
}
void SenserClient::OnStartHighSpeedDemodRawDataStorage(int channel_id, slice_api::DataStorageInfo params,
                                                    const Ice::Current &current)
{
//    int32_t wb_id = 0;
//    m_context->demodServer()->getActiveChannelId(wb_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(wb_id, work_mode);
//    working::DataStorageInfo storage_info{};
//    {
//        storage_info.mode = static_cast<StorageMode>(params.mode);
//        storage_info.size = params.size;
//    }
//    m_context->iceHighSpeedDemodServer()->onStartHighSpeedDemodRawDataStorage(wb_id, work_mode, channel_id,
//                                                                              storage_info);
}
void SenserClient::OnStopHighSpeedDemodRawDataStorage(int channel_id, const Ice::Current &current)
{
//    int32_t wb_id = 0;
//    m_context->demodServer()->getActiveChannelId(wb_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(wb_id, work_mode);
//    m_context->iceHighSpeedDemodServer()->onStopHighSpeedDemodRawDataStorage(wb_id, work_mode, channel_id);
}
void SenserClient::OnHighSpeedDemodRawDataStorageFile(int channel_id, ::std::string filename, const Ice::Current &current)
{
//    int32_t wb_id = 0;
//    m_context->demodServer()->getActiveChannelId(wb_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(wb_id, work_mode);
//    m_context->iceHighSpeedDemodServer()->onHighSpeedDemodRawDataStorageFile(wb_id, work_mode, channel_id, filename);
}
void SenserClient::OnHighSpeedDemodRawDataStorageProgress(int channel_id, slice_api::DataStoreProgress progress,
                                                       const Ice::Current &current)
{
//    int32_t wb_id = 0;
//    m_context->demodServer()->getActiveChannelId(wb_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(wb_id, work_mode);
//    working::DataStoreProgress store_progress{};
//    {
//        store_progress.duration = progress.duration;
//        store_progress.total_bytes = progress.total_bytes;
//    }
//    m_context->iceHighSpeedDemodServer()->onHighSpeedDemodRawDataStorageProgress(wb_id, work_mode, channel_id,
//                                                                                 store_progress);
}
void SenserClient::OnStartHighSpeedDemodResultsStorage(int channel_id, const Ice::Current &current)
{
//    int32_t wb_id = 0;
//    m_context->demodServer()->getActiveChannelId(wb_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(wb_id, work_mode);
//    m_context->iceHighSpeedDemodServer()->onStartHighSpeedDemodResultsStorage(wb_id, work_mode, channel_id);
}
void SenserClient::OnStopHighSpeedDemodResultsStorage(int channel_id, const Ice::Current &current)
{
//    int32_t wb_id = 0;
//    m_context->demodServer()->getActiveChannelId(wb_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(wb_id, work_mode);
//    m_context->iceHighSpeedDemodServer()->onStopHighSpeedDemodResultsStorage(wb_id, work_mode, channel_id);
}
void SenserClient::OnHighSpeedDemodResultsStorageFile(int channel_id, ::std::string filename, const Ice::Current &current)
{
//    int32_t wb_id = 0;
//    m_context->demodServer()->getActiveChannelId(wb_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(wb_id, work_mode);
//    m_context->iceHighSpeedDemodServer()->onHighSpeedDemodResultsStorageFile(wb_id, work_mode, channel_id, filename);
}
void SenserClient::OnHighSpeedDemodResultsStorageProgress(int channel_id, slice_api::DataStoreProgress progress,
                                                       const Ice::Current &current)
{
//    int32_t wb_id = 0;
//    m_context->demodServer()->getActiveChannelId(wb_id);
//    desig::working::DeviceWorkMode work_mode;
//    m_context->deviceServer()->getWorkMode(wb_id, work_mode);
//    working::DataStoreProgress store_progress{};
//    {
//        store_progress.duration = progress.duration;
//        store_progress.total_bytes = progress.total_bytes;
//    }
//    m_context->iceHighSpeedDemodServer()->onHighSpeedDemodResultsStorageProgress(wb_id, work_mode, channel_id,
//                                                                                 store_progress);
}

void SenserClient::OnCreateTaskInfo(desig::slice_api::TaskInfoArray infos, const::Ice::Current& current)
{
}

void SenserClient::OnUpdateTaskInfo(desig::slice_api::TaskInfoArray infos, const::Ice::Current& current)
{
}

void SenserClient::OnDeleteTaskInfo(desig::slice_api::StringArray guids, const::Ice::Current& current)
{
}

void SenserClient::OnTaskExecuteStatus(desig::slice_api::StringArray guids, bool state, const::Ice::Current& current)
{
}

void SenserClient::OnTaskRunningStatus(::std::string guid, desig::slice_api::TaskStatus state, const::Ice::Current& current)
{
}

uint64_t SenserClient::getDeviceId() const
{
    return deviceId;
}

void SenserClient::setDeviceId(const uint64_t &value)
{
    deviceId = value;
}

//#pragma endregion
